﻿using __Able.Network.Packets;
using __Able.Network.ReplyPacket;

namespace __Able.Network.Manager
{
    public class KeepAliveManager
    {
        internal KeepAliveManager() { }
        public Channel channel { get; private set; }
        public User User { get { return channel.User; } }
        internal KeepAliveManager(Channel channel)
        {
            this.channel = channel;
        }

        public void KeepAlive()
        {
            KeepAliveReplyPacket packet = new KeepAliveReplyPacket(User);
            SendPacket(packet);
        }

        private void SendPacket(_BasicOutPacket outpacket)
        {
            channel.PacketManager.SendPacket(outpacket, channel.Port.ToString());
        }
    }
}
